<?php $id = getID();?>
<iframe src="" name="f<?php _e($id);?>" style="display:none"></iframe>
<form method="post" action="<?php _e(actionUrl($this)) ?>" target="f<?php _e($id);?>">
<?php
	$ids = get('ID',array(),true);
	foreach( $ids as $id ){
		_e("<input type='hidden' name='ID[]' value='$id'/>");	
	}
?>
<div class="x-form-container">
	<table width="600" border="0" cellpadding="5" class="x-form">
		<tr>
		<td class="x-form-label" colspan="2"></td>	
		</tr>
		<tr>
			<td class="f-export" colspan="2" align="center">
				<table align="center">
				<tr><td>
					<div class="export-col" onclick="return false">
						<?php foreach( $this->get('fields') as $k => $a ):?>
						<?php if( !$a[1] ):?>
						<div class="export-field" value="<?php _e($k);?>" ondblclick="if( !this.getAttribute('back') ){ Owl(this).parent(1).next(1).child('div').append(this);this.setAttribute('back',1);$(this).find('input').set('disabled',false);}else{ Owl(this).parent(1).pre(1).child('div').append(this) ;this.removeAttribute('back');$(this).find('input').set('disabled',true);} return false">
							<?php _e($a[0]);?>
							<input type="hidden" name="fields[]" value="<?php _e($k);?>" disabled="disabled"/>	
						</div>
						<?php endif;?>
						<?php endforeach;?>
					</div>		
				</td>
				<td class="export-arrow"></td>
				<td>
					<div class="export-col" onclick="return false">
						<?php foreach( $this->get('fields') as $k => $a ):?>
						<?php if( $a[1] ):?>	
						<div class="export-field" back="1" value="<?php _e($k);?>" ondblclick="if( !this.getAttribute('back') ){ Owl(this).parent(1).next(1).child('div').append(this);this.setAttribute('back',1);$(this).find('input').set('disabled',false);}else{ Owl(this).parent(1).pre(1).child('div').append(this) ;this.removeAttribute('back');$(this).find('input').set('disabled',true);} return false">
							<?php _e($a[0]);?>
							<input type="hidden" name="fields[]" value="<?php _e($k);?>"/>
						</div>
						<?php endif;?>
						<?php endforeach;?>						
					</div>		
				</td>
				</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td class="x-form-label" width="60">
				Kiểu xuất:
			</td>
			<td class="x-form-content">
				<?php
					loadClass('ZExport');
					_e( ZExport::htmlOptions() );
				?>
				<label class="lb-export">
				<input type="checkbox" class="x-checkbox" name="order" value="1" checked />
				<span>Hiển thị cột thứ tự</span>
				</label>
			</td>
		</tr>
		<tr>
			<td align="right" colspan="2">
				<input type="submit" class="x-button x-save" value="Xuất file"/>
				<a onclick="remove_frame(this)" class="x-button x-fresh">Hủy bỏ</a>
			</td>
		</tr>		
	</table>	
</div>	
</table>
